home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / GWMALLOC.ZIP;1 / GWMALLOC.TAR / gw_malloc / malloc_loc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-08  |  2.6 KB  |  107 lines

  1. /*
  2.  * local definitions for the user allocation level
  3.  *
  4.  * Copyright 1992 by Gray Watson and the Antaire Corporation
  5.  *
  6.  * This file is part of the malloc-debug package.
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library (see COPYING-LIB); if not, write to the
  20.  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  *
  22.  * The author of the program may be contacted at gray.watson@antaire.com
  23.  *
  24.  * $Id: malloc_loc.h,v 1.15 1993/03/26 09:16:50 gray Exp $
  25.  */
  26.  
  27. #ifndef __MALLOC_LOC_H__
  28. #define __MALLOC_LOC_H__
  29.  
  30. /* fence post checking defines */
  31. #define FENCE_BOTTOM        (1 << ALLOCATION_ALIGNMENT_IN_BITS)
  32. #define FENCE_TOP        sizeof(long)
  33. #define FENCE_OVERHEAD        (FENCE_BOTTOM + FENCE_TOP)
  34. #define FENCE_MAGIC_BASE    0xC0C0AB1B
  35. #define FENCE_MAGIC_TOP        0xFACADE69
  36.  
  37. /*
  38.  * env variables
  39.  */
  40. #define ADDRESS_ENVIRON        "MALLOC_ADDRESS"
  41. #define DEBUG_ENVIRON        "MALLOC_DEBUG"
  42. #define INTERVAL_ENVIRON    "MALLOC_INTERVAL"
  43. #define LOGFILE_ENVIRON        "MALLOC_LOGFILE"
  44. #define START_ENVIRON        "MALLOC_START"
  45.  
  46. /******************************* useful defines ******************************/
  47.  
  48. /*
  49.  * standard int return codes
  50.  */
  51. #undef    ERROR
  52. #define    ERROR        (-1)
  53.  
  54. #undef    NOERROR
  55. #define    NOERROR        0
  56.  
  57. /*
  58.  * generic constants
  59.  */
  60. #undef    NULL
  61. #define NULL        0
  62.  
  63. #undef    NULLC
  64. #define NULLC        '\0'
  65.  
  66. #undef    FALSE
  67. #define FALSE        0
  68.  
  69. #undef    TRUE
  70. #define TRUE        (! FALSE)
  71.  
  72. /*
  73.  * standard i/o file descriptors
  74.  */
  75. #undef    STDIN
  76. #define    STDIN        0        /* fileno(stdin) */
  77.  
  78. #undef    STDOUT
  79. #define    STDOUT        1        /* fileno(stdout) */
  80.  
  81. #undef    STDERR
  82. #define    STDERR        2        /* fileno(stderr) */
  83.  
  84. /*
  85.  * min/max macros
  86.  *
  87.  * WARNING: these use their arguments multiple times which may be bad
  88.  */
  89. #undef MAX
  90. #define MAX(a,b)    (((a) > (b)) ? (a) : (b))
  91. #undef MIN
  92. #define MIN(a,b)    (((a) < (b)) ? (a) : (b))
  93.  
  94. /*
  95.  * bitflag tools for Variable and a Flag
  96.  */
  97. #undef BIT_FLAG
  98. #define BIT_FLAG(x)        (1 << (x))
  99. #undef BIT_SET
  100. #define BIT_SET(v,f)        (v) |= (f)
  101. #undef BIT_CLEAR
  102. #define BIT_CLEAR(v,f)        (v) &= ~(f)
  103. #undef BIT_IS_SET
  104. #define BIT_IS_SET(v,f)        ((v) & (f))
  105.  
  106. #endif /* ! __MALLOC_LOC_H__ */
  107.